﻿@namespace SE.PO.CInterface.Web.Pages.DB.Components
@using SE.PO.CInterface.Web.Clients
@using SE.PO.CInterface.DBProtocols.Devices
@using SE.PO.CInterface.Po.Equips
@using SE.PO.CInterface.Web.Clients.Po
@inject EquipClient Client
@inject INotificationService Notice


<Form
    Model="_model"
    Style="margin-top: 8px;"
    Class="ant-advanced-search-form"
    OnFinish="OnFinish"
    @ref="_form">
    <Row Gutter="24">
        <GridCol Span="16">
            <FormItem Label="设备名">
                <Input Placeholder="设备名" @bind-Value="EquipName"/>
            </FormItem>
        </GridCol>
        <GridCol Span="8">
            <FormItem WrapperColOffset="8" WrapperColSpan="16">
                <Button Type="@ButtonType.Primary" HtmlType="submit" Style="margin-left: 60px;">
                    搜索
                </Button>
                <Button OnClick="Reset"  Style="margin-left: 5px;">
                    清空
                </Button>
            </FormItem>
        </GridCol>
    </Row>
</Form>

<Table @ref="_table"
       TItem="EquipmentDto"
       DataSource="@_source"
       Loading="@_loadingData"
       Total="_total"
       ScrollBarWidth="5px"
       OnChange="OnChange"
       ScrollY="520px"
       @bind-PageIndex="_pageIndex"
       @bind-PageSize="_pageSize"
       @bind-SelectedRows="SelectedEquips"
       Size="TableSize.Small">
    <Selection Key="@(context.Name)"/>
    <PropertyColumn Width="100" Title="顺序编号" Property="c => c.Order"/>
    <PropertyColumn Width="300" Title="名称" Property="c => c.Name"/>
    <PropertyColumn Title="集群" Property="c => c.Cluster"/>
    <PropertyColumn Title="IO" Property="c => c.IODevice"/>
    <PropertyColumn Title="设备Id" Property="c => c.DeviceCode"/>
</Table>